<?php
/**
 * @Author:      lyt
 * @DateTime:    2016-09-13 11:35:32
 * @Description: 用于维护 产品包门店信息
 */
class ProductPackageShop extends Eloquent
{

    protected $table = "product_pack_shop";


	/**
	 * @Author   lyt                      <ahlyt@anhuibj.com>
	 * @DateTime 2018-10-25T17:51:45+0800
	 * @param    [type]                   $shop_id               [description] 门店id
	 * @return   [type]                                       [description] 产品包的id的集合
	 * 用于传入 门店id 获取门店 适配的活动包接口 暂时都只是 到店的
	 */
    public static function getShopPackage($shop_id){
        return ProductPackageShop::where("shop_id",$shop_id)->where("status",1)->select("pack_id")->get()->toArray();
    }

    /**
     * @Author   lyt                      <ahlyt@anhuibj.com>
     * @DateTime 2018-10-25T17:59:19+0800
     * @param    [type]                   $shop_id            [description]
     * @return   [type]                                       [description]
     * 用于判断 该门店是否适配该产品包
     */
    public static function isShopPackage($shop_id,$pack_id){
        return ProductPackageShop::where("shop_id",$shop_id)->where("status",1)->where("pack_id",$pack_id)->first();
    }
     
}
